<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>世界时间转换器</title>
</head>
<body>
<div>Local Time is <span id="local-time"></span></div>
<div id="city-time"></div>
<form action="" name="form1">
    <label for="select-city">
        <select id="select-city" name="lstCity" size="5">
            <option value="60" selected="selected">Berlin</option>
            <option value="330">Bombay</option>
            <option value="0">London</option>
            <option value="180">Moscow</option>
            <option value="-300">New York</option>
            <option value="60">Paris</option>
            <option value="-480">San Francisco</option>
            <option value="600">Sydney</option>
        </select>
    </label>
    <p>
        <label for="adjust-time">
            <input id="adjust-time" type="checkbox" name="chkDst">Adjust city time for Daylight Savings
        </label>
    </p>
</form>
<script>
    var myForm = document.form1;

    function updateTimeZone() {
        var lstCity = myForm.lstCity;
        var selectedOption = lstCity.options[lstCity.selectedIndex];
        var offset = selectedOption.value;
        var selectedCity = selectedOption.text;
        var dstAdjust = 0;
        if (myForm.chkDst.checked) {
            dstAdjust = 60;
        }
        updateOutput(selectedCity, offset, dstAdjust);
    }

    function updateOutput(selectedCity, offset, dstAdjust) {
        var now = new Date();
        document.getElementById('local-time').innerHTML = now.toLocaleString();
        now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(offset, 10) + dstAdjust);
        document.getElementById('city-time').innerHTML = selectedCity + ' time is ' + now.toLocaleString();
    }

    myForm.lstCity.addEventListener('change', updateTimeZone);
    myForm.chkDst.addEventListener('click', updateTimeZone);
</script>
</body>
</html>